{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基座模型评测"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Qwen/Qwen2.5-1.5B-Instruct\n",
    "\n",
    "```bash\n",
    "# 国内需要 export HF_ENDPOINT=https://hf-mirror.com\n",
    "vllm serve Qwen/Qwen2.5-1.5B-Instruct --port 8100 --api-key NLUKKXIJDZ91rpg1z --enforce-eager  --max-model-len 4096\n",
    "\n",
    "CURATOR_VIEWER=1 python eval.py --provider vllm --data_path data/test.jsonl --model_name Qwen/Qwen2.5-1.5B-Instruct --temperature 0.01 --max_tokens 1024\n",
    "\n",
    "https://curator.bespokelabs.ai/datasets/b9f1e2e5129944d28e6c826bff91ee6a  \n",
    "Accuracy: 2/100 (2.00%)\n",
    "```\n",
    "\n",
    "错误原因分析：\n",
    "\n",
    "1. 模型参数量过小，指令理解能力差，不遵循指令中的格式，无法解析出 `<think>` 和 `<answer>` 标签。\n",
    "2. 对指令的内容遵循错误（包括数字的要求等）\n",
    "2. 模型推理陷入死循环。\n",
    "3. 思考超限，但实际测试发现，8192 上下文长度，推理效果也没有变化，还是模型本身问题。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B\n",
    "\n",
    "```bash\n",
    "vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --port 8100 --api-key NLUKKXIJDZ91rpg1z --enforce-eager --max-model-len 10000\n",
    "CURATOR_VIEWER=1 python eval.py --provider vllm --data_path data/test.jsonl --model_name deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --temperature 0.6 --max_tokens 8192 --is_reasoning True\n",
    "\n",
    "https://curator.bespokelabs.ai/datasets/4a12bfd3193744649c704d13a02b0bfb\n",
    "Accuracy: 0/100 (0.00%)\n",
    "```\n",
    "\n",
    "错误原因分析：参数量过小，绝大部分是指令遵循的问题。特别是 DeepSeek 打上思考钢印，不用 `<answer>` 标签，而是用 `\\boxed{}` Latex 格式。\n",
    "\n",
    "实际检查，效果比 Qwen/Qwen2.5-1.5B-Instruct 要好。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## DeepSeek R1\n",
    "\n",
    "```bash\n",
    "CURATOR_VIEWER=1 python eval.py --provider openrouter --data_path data/test.jsonl --model_name deepseek-ai/DeepSeek-R1:floor --temperature 0.6 --max_tokens 8192 --is_reasoning True\n",
    "\n",
    "https://curator.bespokelabs.ai/datasets/a78b393f95e646c1acd1cb6221621a79 \n",
    "\n",
    "\n",
    "Accuracy: 82/100 (82.00%)\n",
    "```\n",
    "\n",
    "错误分析: 大部分错误都是思考超过了8k限制导致，其他的都基本正确。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## TODO: 测试更多的模型的效果"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
